#ifndef __STRUCTURE_H__
#define __STRUCTURE_H__

#include <vector>

// GTK関連
#ifndef _WITHOUT_GUI
 #include <gtk/gtk.h>

 typedef struct {
   GtkWidget *window;
   int screen_offset_x;
   int screen_offset_y;
   double screen_resolution; // meter per pixel
   GdkGC *gc;
 }GuiInterface;
#endif


typedef struct {
     double x, y, theta;
}Point;

typedef struct{
  Point p1;
  Point p2;
}Line;

// MapManagementから取得するため分離予定
// ラインマップの最大の直線数
#define MAX_LINEMAP_SIZE (1000)
typedef struct {
  Line data[MAX_LINEMAP_SIZE];
  int numdata;
}LineMap;

// MapManagementから取得するため分離予定
// ポイントマップの最大の点数
#define MAX_POINTMAP_SIZE (3000*2000)
typedef struct {
  Point data[MAX_POINTMAP_SIZE];
  int numdata;
} PointMap;

// MapManagementから取得するため分離予定
// 占有グリッドマップの最大サイズ
#define MAX_OCCUPANCY_GRIDMAP_SIZE (3000*2000)
typedef struct {
  int origin_x;
  int origin_y;
  int width;
  int height;
  unsigned char data[MAX_OCCUPANCY_GRIDMAP_SIZE];
  double resolution;
} OccupancyGridMap;

typedef struct{
  double total_points;
  double offset_fov; // offset of fov[rad]
  double fov; // field of view[rad]
  double resolution; // [rad]
  std::vector<double> range; // [m]
}LaserRangeData;


// types for particle filter
typedef struct {
     float x,y,theta,weight;
} LocalizerParticle;

typedef struct{
  int ready;
  int initialized;
  int num_particles;
  LocalizerParticle *particles;
  double sum_weight;
  LocalizerParticle max_particle;
} LocalizerParticleFilter ;

typedef struct{
  double x, y, theta;
} LocalizerOdometry;

typedef struct{
  LocalizerParticleFilter *filter;
  LocalizerParticleFilter *prev_filter;
  LocalizerOdometry odometry;
  LocalizerOdometry prev_odometry;
  LaserRangeData lrf;
  LineMap lmap ;
  PointMap pmap;
  OccupancyGridMap ogmap;
} Mcl;

#endif /* __STRUCTURE_H__ */
